// @ts-check
import { defineConfig } from "astro/config";
import vue from "@astrojs/vue";
import tailwind from "@astrojs/tailwind";
import markdoc from "@astrojs/markdoc";
import icon from "astro-icon";

// https://astro.build/config
export default defineConfig({
  site: "https://hollysys.atomgit.net",
  integrations: [
    tailwind(),
    vue(),
    icon({
      iconDir: "src/assets/icons",
      include: {
        mdi: ["*"],
      },
    }),
    markdoc({
      allowHTML: true,
      ignoreIndentation: true,
    }),
  ],
  markdown: {
    shikiConfig: {
      langAlias: {
        cjs: "javascript",
      },
      theme: "one-light",
      wrap: true,
    },
  },
  prefetch: true,
  vite: {
    build: {
      minify: false,
    },
    server: {
      proxy: {
        "/csdn_host": {
          target: "https://rss.csdn.net",
          changeOrigin: true,
          rewrite: (path) => path.replace(/^\/csdn_host/, ""),
        },
      },
    },
  },
  server: {
    host: true,
  },
  i18n: {
    defaultLocale: "zh-cn",
    locales: ["zh-cn", "en-us"],
    routing: {
      prefixDefaultLocale: false,
    },
  },
});
